package com.umeng.analytics.pro;

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.Collections;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class bn implements cg, Serializable, Cloneable {
    static class a extends dp {
        private a() {

        }

        public void a(df arg7, bn arg8) throws cm {
            arg7.j();
            while (true) {
                da v0 = arg7.l();
                if (v0.b == 0) {
                    break;
                }

                switch (v0.c) {
                    case 1: {
                        if (v0.b == 13) {
                            dc v1 = arg7.n();
                            arg8.a = new HashMap(v1.c * 2);
                            int v0_1;
                            for (v0_1 = 0; v0_1 < v1.c; ++v0_1) {
                                String v2 = arg7.z();
                                bo v3 = new bo();
                                v3.a(arg7);
                                arg8.a.put(v2, v3);
                            }

                            arg7.o();
                            arg8.a(true);
                            break;
                        }

                        di.a(arg7, v0.b);
                        break;
                    }
                    case 2: {
                        if (v0.b == 8) {
                            arg8.b = arg7.w();
                            arg8.b(true);
                            break;
                        }

                        di.a(arg7, v0.b);
                        break;
                    }
                    case 3: {
                        if (v0.b == 11) {
                            arg8.c = arg7.z();
                            arg8.c(true);
                            break;
                        }

                        di.a(arg7, v0.b);
                        break;
                    }
                    default: {
                        di.a(arg7, v0.b);
                        break;
                    }
                }

                label_9:
                arg7.m();
            }

            arg7.k();
            if (!arg8.i()) {
                throw new dg("Required field \'version\' was not found in serialized data! Struct: " + this.toString());
            }

            arg8.m();
        }

        public void a(df arg1, cg arg2) throws cm {
            this.b(arg1, ((bn) arg2));
        }

        public void b(df arg5, bn arg6) throws cm {
            arg6.m();
            arg5.a(bn.n());
            if (arg6.a != null) {
                arg5.a(bn.o());
                arg5.a(new dc((byte)11, (byte)12, arg6.a.size()));
                Iterator v2 = arg6.a.entrySet().iterator();
                while (v2.hasNext()) {
                    Object v0 = v2.next();
                    arg5.a((String) ((Map.Entry) v0).getKey());
                    ((bo)((Map.Entry) v0).getValue()).b(arg5);
                }

                arg5.e();
                arg5.c();
            }

            arg5.a(bn.q());
            arg5.a(arg6.b);
            arg5.c();
            if (arg6.c != null) {
                arg5.a(bn.r());
                arg5.a(arg6.c);
                arg5.c();
            }

            arg5.d();
            arg5.b();
        }

        public void b(df arg1, cg arg2) throws cm {
            this.a(arg1, ((bn) arg2));
        }
    }

    static class b implements do0 {

        private b() {

        }

        public a a() {
            return new a();
        }

        public dn b() {
            return this.a();
        }
    }

    static class c extends dq {
        private c() {

        }

        public void a(df arg4, bn arg5) throws cm {
            ((dl) arg4).a(arg5.a.size());
            Iterator v2 = arg5.a.entrySet().iterator();
            while (v2.hasNext()) {
                Object v0 = v2.next();
                ((dl) arg4).a((String) ((Map.Entry) v0).getKey());
                ((bo)((Map.Entry) v0).getValue()).b(arg4);
            }
            ((dl) arg4).a(arg5.b);
            ((dl) arg4).a(arg5.c);
        }

        public void a(df arg1, cg arg2) throws cm {
            this.a(arg1, ((bn) arg2));
        }

        public void b(df arg7, bn arg8) throws cm {
            dc v1 = new dc(((byte) 11), ((byte) 12), ((dl) arg7).w());
            arg8.a = new HashMap(v1.c * 2);
            int v0;
            for (v0 = 0; v0 < v1.c; ++v0) {
                String v2 = ((dl) arg7).z();
                bo v3 = new bo();
                v3.a(arg7);
                arg8.a.put(v2, v3);
            }

            arg8.a(true);
            arg8.b = ((dl) arg7).w();
            arg8.b(true);
            arg8.c = ((dl) arg7).z();
            arg8.c(true);
        }

        public void b(df arg1, cg arg2) throws cm {
            this.b(arg1, ((bn) arg2));
        }
    }

    static class d implements do0 {
        private d() {

        }

        public c a() {
            return new c();
        }

        public dn b() {
            return this.a();
        }
    }

    public enum bn$e implements cn {
        PROPERTY((short) 1, "property"),
        VERSION((short) 2, "version"),
        CHECKSUM((short) 3, "checksum");

        private static final Map<String, bn$e> d = new HashMap();
        private final short e;
        private final String f;

        static {
            Iterator it = EnumSet.allOf(bn$e.class).iterator();
            while (it.hasNext()) {
                bn$e eVar = (bn$e) it.next();
                d.put(eVar.b(), eVar);
            }
        }

        private bn$e(short s, String str) {
            this.e = s;
            this.f = str;
        }

        public static bn$e a(int i) {
            switch (i) {
                case 1:
                    return PROPERTY;
                case 2:
                    return VERSION;
                case 3:
                    return CHECKSUM;
                default:
                    return null;
            }
        }

        public static bn$e a(String str) {
            return d.get(str);
        }

        public static bn$e b(int i) {
            bn$e a = a(i);
            if (a != null) {
                return a;
            }
            throw new IllegalArgumentException("Field " + i + " doesn't exist!");
        }

        public final short a() {
            return this.e;
        }

        public final String b() {
            return this.f;
        }
    }

    public Map a;
    public int b;
    public String c;
    public static final Map<bn$e, cs> d;
    private static final long e = 2846460275012375038L;
    private static final dk f = new dk("Imprint");
    private static final da g = new da("property", (byte) 13, (short) 1);
    private static final da h = new da("version", (byte) 8, (short) 2);
    private static final da i = new da("checksum", (byte) 11, (short) 3);
    private static final Map<Class<? extends dn>, do0> j = new HashMap();
    private static final int k = 0;
    private byte l;

    static{
        j.put(dp.class, new b());
        j.put(dq.class, new d());
        EnumMap v0_1 = new EnumMap(bn$e.class);
        ((Map) v0_1).put(bn$e.PROPERTY, new cs("property", (byte) 1, new cv((byte) 13, new ct((byte) 11), new cx((byte) 12, bo.class))));
        ((Map) v0_1).put(bn$e.VERSION, new cs("version", (byte) 1, new ct((byte) 8)));
        ((Map) v0_1).put(bn$e.CHECKSUM, new cs("checksum", (byte) 1, new ct((byte) 11)));
        d = Collections.unmodifiableMap(v0_1);
        cs.a(bn.class, d);
    }

    public bn() {

        this.l = 0;
    }

    public bn(bn arg6) {
        this.l = 0;
        this.l = arg6.l;
        if (arg6.f()) {
            HashMap v2 = new HashMap();
            Iterator v3 = arg6.a.entrySet().iterator();
            while (v3.hasNext()) {
                Object v0 = v3.next();
                ((Map) v2).put(((Map.Entry) v0).getKey(), new bo((bo) ((Map.Entry) v0).getValue()));
            }

            this.a = v2;
        }

        this.b = arg6.b;
        if (arg6.l()) {
            this.c = arg6.c;
        }
    }

    public bn(Map arg2, int arg3, String arg4) {
        this();
        this.a = arg2;
        this.b = arg3;
        this.b(true);
        this.c = arg4;
    }

    public bn a(int arg2) {
        this.b = arg2;
        this.b(true);
        return this;
    }

    public bn a(String arg1) {
        this.c = arg1;
        return this;
    }

    private void a(ObjectInputStream arg3) throws IOException, ClassNotFoundException {
        try {
            this.l = 0;
            this.a(new cz(new dr(((InputStream) arg3))));
            return;
        } catch (cm v0) {
            throw new IOException(v0.getMessage());
        }
    }

    public void a(df arg3) throws cm {
        bn.j.get(arg3.D()).b().b(arg3, ((cg) this));
    }

    private void a(ObjectOutputStream arg3) throws IOException {
        try {
            this.b(new cz(new dr(((OutputStream) arg3))));
            return;
        } catch (cm v0) {
            throw new IOException(v0.getMessage());
        }
    }

    public bn a() {
        return new bn(this);
    }

    public bn a(Map arg1) {
        this.a = arg1;
        return this;
    }

    public void a(String arg2, bo arg3) {
        if (this.a == null) {
            this.a = new HashMap();
        }

        this.a.put(arg2, arg3);
    }

    public void a(boolean arg2) {
        if (!arg2) {
            this.a = null;
        }
    }

    public void b(boolean arg3) {
        this.l = cd.a(this.l, 0, arg3);
    }

    public void b(df arg3) throws cm {
        bn.j.get(arg3.D()).b().a(arg3, ((cg) this));
    }

    public cn b(int arg2) {
        return (cn) this.c(arg2);
    }

    public void b() {
        this.a = null;
        this.b(false);
        this.b = 0;
        this.c = null;
    }

    public bn$e c(int arg2) {
        return bn.bn$e.a(arg2);
    }

    public int c() {
        int v0 = this.a == null ? 0 : this.a.size();
        return v0;
    }

    public void c(boolean arg2) {
        if (!arg2) {
            this.c = null;
        }
    }

    public Map d() {
        return this.a;
    }

    public void e() {
        this.a = null;
    }

    public boolean f() {
        boolean v0 = this.a != null ? true : false;
        return v0;
    }

    public int g() {
        return this.b;
    }

    public void h() {
        this.l = cd.b(this.l, 0);
    }

    public boolean i() {
        return cd.a(this.l, 0);
    }

    public String j() {
        return this.c;
    }

    public void k() {
        this.c = null;
    }

    public boolean l() {
        boolean v0 = this.c != null ? true : false;
        return v0;
    }

    public void m() throws cm {
        if (this.a == null) {
            throw new dg("Required field \'property\' was not present! Struct: " + this.toString());
        }

        if (this.c == null) {
            throw new dg("Required field \'checksum\' was not present! Struct: " + this.toString());
        }
    }

    static dk n() {
        return bn.f;
    }

    static da o() {
        return bn.g;
    }

    public cg p() {
        return this.a();
    }

    static da q() {
        return bn.h;
    }

    static da r() {
        return bn.i;
    }

    public String toString() {
        StringBuilder v0 = new StringBuilder("Imprint(");
        v0.append("property:");
        if (this.a == null) {
            v0.append("null");
        } else {
            v0.append(this.a);
        }

        v0.append(", ");
        v0.append("version:");
        v0.append(this.b);
        v0.append(", ");
        v0.append("checksum:");
        if (this.c == null) {
            v0.append("null");
        } else {
            v0.append(this.c);
        }

        v0.append(")");
        return v0.toString();
    }
}

